package com.gwnet.shop.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.gwnet.common.log.annotation.Log;
import com.gwnet.common.log.enums.BusinessType;
import com.gwnet.shop.domain.SysTenant;
import com.gwnet.shop.utils.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gwnet.shop.service.ITenantOpenhoursService;

import javax.annotation.Resource;

/**
 * 店铺营业时间段,一个店铺可以有多个营业时间段Controller
 * @author zhangwanpeng
 * @date 2024-08-05
 */
@RestController
@RequestMapping("/openhours")
public class TenantOpenhoursController extends MBaseController
{
    @Resource
    private ITenantOpenhoursService tenantOpenhoursService;

    /**
     * 查询店铺营业时间段,一个店铺可以有多个营业时间段列表
     */
    /*@SaCheckPermission("shop:openhours:list")
    @GetMapping("/list")
    public TableDataInfo list(TenantOpenhours tenantOpenhours)
    {
        startPage();
        List<TenantOpenhours> list = tenantOpenhoursService.selectTenantOpenhoursList(tenantOpenhours);
        return getDataTable(list);
    }*/


    /**
     * 获取店铺营业时间段,一个店铺可以有多个营业时间段详细信息
     */
   /* @SaCheckPermission("shop:openhours:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tenantOpenhoursService.selectTenantOpenhoursById(id));
    }*/

    /**
     * 新增店铺营业时间段,一个店铺可以有多个营业时间段
     */
    /*@SaCheckPermission("shop:openhours:add")
    @Log(title = "店铺营业时间段,一个店铺可以有多个营业时间段", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TenantOpenhours tenantOpenhours)
    {
        return toAjax(tenantOpenhoursService.insertTenantOpenhours(tenantOpenhours));
    }*/


    /**
     * 修改店铺营业时间段,一个店铺可以有多个营业时间段
     */
   /* @SaCheckPermission("shop:openhours:edit")
    @Log(title = "店铺营业时间段,一个店铺可以有多个营业时间段", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TenantOpenhours tenantOpenhours)
    {
        return toAjax(tenantOpenhoursService.updateTenantOpenhours(tenantOpenhours));
    }*/


    /**
     * 修改店铺营业时间段,一个店铺可以有多个营业时间段
     */
    @SaCheckPermission("shop:openhours:edit")
    @Log(title = "店铺营业时间段,一个店铺可以有多个营业时间段", businessType = BusinessType.UPDATE)
    @PostMapping
    public AjaxResult editByTenantId(@RequestBody SysTenant tenant)
    {
        return toAjax(tenantOpenhoursService.updateTenantOpenhoursByTenantId(tenant));
    }


    /**
     * 删除店铺营业时间段,一个店铺可以有多个营业时间段
     */
    /*@SaCheckPermission("shop:openhours:remove")
    @Log(title = "店铺营业时间段,一个店铺可以有多个营业时间段", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tenantOpenhoursService.deleteTenantOpenhoursByIds(ids));
    }*/
}
